import scala.util.control.Breaks

/**
  * description:
  **/
object TestWhile {


  def main(args: Array[String]): Unit = {

    val s1 = "s,c,a".split(",")
    val s2 = "j,v".split(",")
    val s3 = "p,y".split(",")

    val ss = "svyp"


    var sss = ""

    val loop = new Breaks;

    // 在 breakable 中循环
    loop.breakable{
      // 循环
      for(s<-s1){
        for(i<-s2){
          for (j<-s3){

            println(s+","+i+","+j)
            println("---------")

            if(ss.contains(s) && ss.contains(i) && ss.contains(j)){

              sss= s+","+i+","+j

              loop.break;
            }
            println("cc")

          }

          println("vv")
        }
      }

        // 循环中断
      //        loop.break;
    }

    if(""!=sss){
      println(sss+"---")
    }


  }

}
